package com.haier.dreambox.demo.bean.Event;


import android.os.Message;
import com.haier.uhome.usdk.api.uSDKDeviceAttribute;

import java.util.HashMap;
import java.util.Set;

/**
 * SDK上报设备状态变化Event
 *
 * @author 薛显亮
 */
public class HaieruDeviceStatusEvent {

    private String mac;
    private HashMap<String, uSDKDeviceAttribute> attributes;

    /**
     * @param message SDK上报
     */
    public HaieruDeviceStatusEvent(Message message) {

        HashMap msgObj = (HashMap) message.obj;
        if (msgObj != null) {
            Set keySet = msgObj.keySet();
            mac = (String) keySet.iterator().next();
            attributes = (HashMap) msgObj.get(mac);
        }


    }

    public String getMac() {
        return mac;
    }

    public HashMap<String, uSDKDeviceAttribute> getAttributes() {
        return attributes;
    }
}
